package util.android.form;

import android.content.Context;
import util.android.window.AceptarCancelarDialog;
import util.form.respuesta.Input;

public class DialogOmision 
extends AceptarCancelarDialog
{
	private Input input;
	
	public DialogOmision(Context context, Input input) {
		super(context, input.getContext());
		this.input=input;
	}

	public boolean mostrar() {
		if(input.isVacio()) {				
			setTitle(input.getTituloPreguntaOmision());
			
			/*
			setOnAceptarCancelarListener(new OnAceptarCancelarListener() {
				
				@Override
				public void onCerrar() throws Exception {
					
				}
				
				@Override
				public void onCancelar() throws Exception {
					
				}
				
				@Override
				public void onAceptar() throws Exception {
									
				}
			});
			*/
			
			this.show();
			return true;
		}
		return false;
	}
	
	@Override
	public boolean onAceptar() throws Exception {
		input.setMissing();
		input.requestFocus();
		//setValor(getMissing(),getMissing());	
		return true;
	}
}
